﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using Itop.KSRY.Model;
using DevExpress.XtraEditors;

namespace Itop.KSRY {
    public partial class UCsetup : XtraUserControl {
        public UCsetup() {
            InitializeComponent();
        }
        public bool Save() {
            sysset sset = syssetBindingSource.DataSource as sysset;
            if (sset != null)
                DBHelper.SqlMapper.Update<sysset>(sset);
            return true;
        }
        public void Init() {
            sysset sset = DBHelper.SqlMapper.GetOneByKey<sysset>("0");
            if (sset == null) {
                sset = new sysset();
                DBHelper.SqlMapper.Create<sysset>(sset);
            }
            syssetBindingSource.DataSource = sset;
        }
    }
}
